package com.easylinkin.linkappapi.grid.controller;

import com.easylinkin.linkappapi.common.model.BaseController;
import com.easylinkin.linkappapi.grid.models.dto.GridHiddenDangerInfoDTO;
import com.easylinkin.linkappapi.grid.service.IGridHiddenDangerInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Setter;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import site.morn.rest.RestBuilders;
import site.morn.rest.RestMessage;

import javax.annotation.Resource;

/**
 * 网格隐患info
 *
 * @author kyj
 * @date 2024/5/31 18:41
 */
@Api(tags = "网格隐患info")
@Setter(onMethod_ = @Resource)
@RestController
@RequestMapping("/grid/gridHiddenDangerInfo")
public class GridHiddenDangerInfoController extends BaseController {

    private IGridHiddenDangerInfoService gridHiddenDangerInfoService;


    /**
     * 关闭隐患
     *
     * @param dto
     * @return
     */
    @ApiOperation(value = "关闭隐患", notes = "关闭隐患")
    @PostMapping(value = "/close")
    public RestMessage close(@RequestBody GridHiddenDangerInfoDTO dto) {
        this.setOperator(dto);
        gridHiddenDangerInfoService.close(dto);
        return RestBuilders.successBuilder().message("保存成功").build();
    }

}
